import React, {useContext, useEffect, useState} from 'react';
import { Alert, View ,ImageBackground} from 'react-native';
import { Button, Image, Text } from 'react-native-elements';

import LocaleContext from '../libs/locale';

import WebBrowser from '../components/webComponentDM'
import WalletContext from "../libs/wallet";

const WebBrowserDM = ({ navigation ,route}: any) => {
    const locale = useContext(LocaleContext);
    const wallet: any = useContext(WalletContext);
    const [isUpdateAlert, setIsUpdateAlert] = useState(0);
    const url = route?.params?.url || false;
    const address = route?.params?.address || null;
    const showExplore = route?.params?.showExplore || false;
    const title = route?.params?.title || "区块浏览器";

    useEffect(()=>{
        navigation.setOptions({ title: title })
    },[])



    return (
        // @ts-ignore
        <WebBrowser url={url} showBottom={true} address={address} showExplore={showExplore} title={title} navigation={navigation} locale={locale} wallet={wallet}/>
    );
};

export default WebBrowserDM;
